package io;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FOSDemo {
    public static void main(String[] args) throws IOException {
        File file =new File("./fos.dat");
        FileOutputStream fos = new FileOutputStream(file);
        //FileOutputStream fos = new FileOutputStream("fos.dat");
       /* fos.write(11);//向fos.bat中写入了一个字节
        fos.write(-2);//向fos.bat中又写入了一个字节
        System.out.println("写出完毕");*/
        fos.write(-255);// 11111111
        fos.close();//关闭流
        int a = -255;
        System.out.println(Integer.toBinaryString(a));
        System.out.println("----------------------------");
        for(int i = 0;i<=256;i++){
            System.out.println(Integer.toBinaryString(-i)+"  "+(-i));
        }
    }
}
